# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=dbus
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.10.10
pkgrel=1
arch=('any')
pkgdesc="Freedesktop.org message bus system (mingw-w64)"
depends=("${MINGW_PACKAGE_PREFIX}-glib2"
         "${MINGW_PACKAGE_PREFIX}-expat")
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc"
             "${MINGW_PACKAGE_PREFIX}-pkg-config"
             "${MINGW_PACKAGE_PREFIX}-python2"
             "xmlto")
options=('strip' 'staticlibs')
license=("BSD")
url="https://www.freedesktop.org/wiki/Software/dbus"
source=("https://dbus.freedesktop.org/releases/dbus/${_realname}-${pkgver}.tar.gz"{,.asc})
sha256sums=('9d8f1d069ab4d1a0255d7b400ea3bcef4430c42e729b1012abb2890e3f739a43'
            'SKIP')

prepare() {
  cd "${srcdir}"/${_realname}-${pkgver}
}

build() {
  mkdir -p build-${MINGW_CHOST}
  cd build-${MINGW_CHOST}

  ../${_realname}-${pkgver}/configure \
    --host=${MINGW_CHOST} \
    --target=${MINGW_CHOST} \
    --build=${MINGW_CHOST} \
    --prefix=${MINGW_PREFIX} \
    --enable-xml-docs \
    --disable-systemd \
    --enable-shared \
    --enable-static

  make
}

check() {
  cd build-${MINGW_CHOST}
  make check
}

package() {
  cd "${srcdir}/build-${MINGW_CHOST}"
  make DESTDIR=${pkgdir} install
}
